package com.kgc.personcommon.remote;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.personcommon.pojo.User;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

public interface UserRemote {
    @RequestMapping("getUserPage")
    @ResponseBody
    ResponseMsg getUserPage(@RequestBody Map<String, Object> params);

    @RequestMapping("addUser")
    @ResponseBody
    ResponseMsg addUser(@RequestBody User user);

    @RequestMapping("updateUser")
    @ResponseBody
    ResponseMsg updateUser(@RequestBody User user);

    @RequestMapping("delUser")
    @ResponseBody
    ResponseMsg delUser(@RequestParam("id") Integer id);

    @RequestMapping("getUserById")
    @ResponseBody
    ResponseMsg getUserById(@RequestParam("id") Integer id);

    @RequestMapping("getAllUser")
    @ResponseBody
    ResponseMsg getAllUser(@RequestBody Map<String, Object> params);

    @RequestMapping("login")
    @ResponseBody
    ResponseMsg login(@RequestParam("account") String account, @RequestParam("password") String password, @RequestParam("checkCode") String checkCode);

    @RequestMapping("getCaptcha")
    @ResponseBody
    String getCaptcha();  // 返回 Base64 编码的验证码图片

    @RequestMapping("logout")
    @ResponseBody
    ResponseMsg logout(@RequestBody Map<String, String> request);


    @RequestMapping("getTreePermissionsByUserId")
    @ResponseBody
    public ResponseMsg getTreePermissionsByUserId(@RequestParam("account") String account);


    @RequestMapping("refresh")
    @ResponseBody
    public ResponseMsg refresh(@RequestBody Map<String, String> map);

    @RequestMapping("selectUserByMap")
    @ResponseBody
    ResponseMsg selectUserByMap(@RequestBody Map<String,Object> map);
}
